package com.safe.ly_safe.base;

import com.safe.ly_safe.control.view.MainView;

/**
 * @PACKAGE :com.safe.ly_safe.base
 * @Author : HSF
 * @Time : On 2022/4/22 15:37
 * @Description : BasePresenter
 */
public class BasePresenter<V extends MainView> {

    protected V mView;

    /**
     * 绑定view，一般在初始化中调用该方法
     *
     * @param view view
     */
    public void attachView(V view) {
        this.mView = view;
    }

    /**
     * 解除绑定view，一般在onDestroy中调用
     */

    public void detachView() {
        this.mView = null;
    }

    /**
     * View是否绑定
     *
     * @return
     */
    public boolean isViewAttached() {
        return mView != null;
    }

}
